﻿// || - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ||
// || euzo.ca                                                                         | 2153735 Ontario Ltd. | Mississauga, Ontario, CANADA ||
// || - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ||

#region Implemented Namespaces

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;

using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell;
using OLE = Microsoft.VisualStudio.OLE.Interop;

#endregion

namespace EuzoCa.CodeGenerator
{
    /// <summary>
    /// Extends the Xsl functions with additional functions written in Cs.
    /// </summary>
    public class CodeGeneratorUtil
    {
        /// <summary>
        /// The default namespace.
        /// </summary>
        public string DefaultNamespace;

        /// <summary>
        /// The folder path where the file to convert is.
        /// </summary>
        public string FolderPath;

        /// <summary>
        /// The file name, excluding the path.
        /// </summary>
        public string FileName;

        /// <summary>
        /// Return the default namespace.
        /// </summary>
        /// <returns>The default namespace.</returns>
        public string GetDefaultNamespace()
        {
            return this.DefaultNamespace;
        }

        /// <summary>
        /// Return the folder path where the file to convert is.
        /// </summary>
        /// <returns>The folder path where the file to convert is.</returns>
        public string GetFolderPath()
        {
            return this.FolderPath;
        }

        /// <summary>
        /// Return the file name, excluding the path.
        /// </summary>
        /// <returns>The file name, excluding the path.</returns>
        public string GetFileName()
        {
            return this.FileName;
        }

        /// <summary>
        /// Get a new guid.
        /// </summary>
        /// <returns>The Guid as string.</returns>
        public string GetNewGuid()
        {
            return Guid.NewGuid().ToString();
        }

        /// <summary>
        /// Get the Cs hash code of an object.
        /// </summary>
        /// <param name="obj">A reference to the object.</param>
        /// <returns>0 if null, or the object hash code.</returns>
        public int GetHashCode(object obj)
        {
            if (obj == null)
            {
                return 0;
            }
            return obj.GetHashCode();
        }
    }
}
